<!-- @Author: Yu_Bo -->
<template>
	<view class="scancode">
		<u-popup v-model="show" mode="center" :mask-close-able="false">
			<view class="main">
				<view class="main_title">
					货架号
				</view>
				<view class="main_list">
					<view class="list" v-for="(item,index) in list" :key="index">
						{{item.shelf_number}}
						<text>数量：{{item.goods_num}}</text>
					</view>
				</view>
			</view>
			<view class="close">
				<image @click="closeBtn" src="@/static/images/img/close.png" mode=""></image>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		components: {},
		props: {},
		data() {
			return{
				show: false,
				list: []
			}
		},
		computed: {},
		mounted() {},
		methods: {
			// 打开
			openBtn(item) {
				this.show = true
				this.getInfo(item)
			},
			// 关闭
			closeBtn() {
				this.info = null
				this.show = false
			},
			getInfo(item) {
				var that = this
				var params = {
					goods_id: item.goods_id,
					condition: item.condition
				}
				that.$httpApi.orderSearch(params).then((res) => {
					if (res.code == 1) {
						console.log(res)
						that.list = res.data
					}
				})
			},
		},
	}
</script>

<style lang='scss' scoped>
	.scancode {
		.main {
			width: 600rpx;
			padding: 50rpx;
			border-radius: 40rpx;
			background: linear-gradient(to bottom, #6FECFF, #F5FEFF, #FFFFFF);
			
			.main_title {
				width: 100%;
				padding-bottom: 40rpx;
				text-align: center;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 36rpx;
				color: #222222;
			}
			
			.main_list {
				width: 100%;
				
				.list {
					width: 100%;
					padding: 10rpx 0;
					font-size: 28rpx;
					color: #222222;
					display: flex;
					align-items: center;
					justify-content: center;
					
					text {
						padding-left: 20rpx;
					}
				}
			}
			
		}
		
		.close {
			width: 100%;
			padding-top: 120rpx;
			
			image {
				display: block;
				width: 80rpx;
				height: 80rpx;
				margin: auto;
			}
		}
	}
</style>